import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


// 公共路由
export const constantRoutes = [{
        path: '/',
        component: (resolve) => require(['@/views/login'], resolve),
        hidden: true
    },
    {//登录页
        path: '/login',
        component: (resolve) => require(['@/views/login'], resolve),
        hidden: true
    },
    {//案例
        path: '/case',
        component: (resolve) => require(['@/views/case/index'], resolve),
        hidden: true
    },
    {//案例移动端三段式布局
        path: '/threeSections',
        component: (resolve) => require(['@/views/case/threeSections'], resolve),
        hidden: true
    },
    {//案例移动端购物车
        path: '/showpingCar',
        component: (resolve) => require(['@/views/case/showpingCar'], resolve),
        hidden: true
    },
    {//首页（退出）
        path: '/index',
        component: (resolve) => require(['@/views/index'], resolve),
        hidden: true
    },
    {
        path: '/404',
        component: (resolve) => require(['@/views/error/404'], resolve),
        hidden: true
    },
    {
        path: '/401',
        component: (resolve) => require(['@/views/error/401'], resolve),
        hidden: true
    },

]

export default new Router({
    mode: 'history', // 去掉url中的#
    scrollBehavior: () => ({
        y: 0
    }),
    routes: constantRoutes
})